﻿Public Class crtrastreadores

    Private Sub RASTREADORESBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.RASTREADORESBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.RASTREADORESDataSet)

    End Sub

    Private Sub crtrastreadores_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.RASTREADORESTableAdapter.Fill(Me.RASTREADORESDataSet.RASTREADORES)
        TextBox2.Focus()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RASTREADORESBindingSource.MoveFirst()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        RASTREADORESBindingSource.MovePrevious()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        RASTREADORESBindingSource.AddNew()
        TextBox2.Focus()
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Try
            Me.Validate()
            Me.RASTREADORESBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.RASTREADORESDataSet)
        Catch ex As Exception
            MsgBox("Erro na inserção dos dados" + Environment.NewLine + ex.ToString, MsgBoxStyle.Information, "Atenção")
        End Try
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        Try
            Me.Validate()
            RASTREADORESBindingSource.RemoveCurrent()
            RASTREADORESTableAdapter.Update(RASTREADORESDataSet.RASTREADORES)
        Catch ex As Exception
            MsgBox("Erro ao deletar os dados" + Environment.NewLine + ex.ToString, MsgBoxStyle.Information, "Atenção")
        End Try
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        RASTREADORESBindingSource.MoveNext()
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        RASTREADORESBindingSource.MoveLast()
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
        If TextBox2.Text = "" Then
            MsgBox("Favor informar o numero do termo para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByTERMO(RASTREADORESDataSet.RASTREADORES, TextBox2.Text)
        End If
    End Sub

    Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click
        If TextBox7.Text = "" Then
            MsgBox("Favor informar o numero da placa para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByPLACA(RASTREADORESDataSet.RASTREADORES, TextBox7.Text)
        End If
    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        If TextBox8.Text = "" Then
            MsgBox("Favor informar o numero do renavam para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByRENAVAM(RASTREADORESDataSet.RASTREADORES, TextBox8.Text)
        End If
    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        If ComboBox1.Text = "" Then
            MsgBox("Favor informar a marca para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByMARCA(RASTREADORESDataSet.RASTREADORES, ComboBox1.Text)
        End If
    End Sub

    Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button13.Click
        If TextBox9.Text = "" Then
            MsgBox("Favor informar o numero do chassi para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByCHASSI(RASTREADORESDataSet.RASTREADORES, TextBox9.Text)
        End If
    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button12.Click
        If TextBox3.Text = "" Then
            MsgBox("Favor informar o tipo para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByTIPO(RASTREADORESDataSet.RASTREADORES, TextBox3.Text)
        End If
    End Sub

    Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button15.Click
        If MaskedTextBox1.Text = "  /  /" Then
            MsgBox("Favor informar a data da instalação para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillByDATA(RASTREADORESDataSet.RASTREADORES, MaskedTextBox1.Text)
        End If
    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        If ComboBox2.Text = "" Then
            MsgBox("Favor informar a seguradora para pesquisa.", MsgBoxStyle.Information, "Atenção")
        Else
            RASTREADORESTableAdapter.FillBySEGURADORA(RASTREADORESDataSet.RASTREADORES, ComboBox2.Text)
        End If
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
        RASTREADORESTableAdapter.Fill(RASTREADORESDataSet.RASTREADORES)
    End Sub
End Class